// import request from "@/api/request";
import {req_login} from '@/api/registerLogin';
export default {
    async login_a({ commit }, { user_name, password,routerT }) {


        console.log(user_name, password,routerT);

        // let result = await request({
            // method: 'post', url: '/login', arg: { user_name, password }
            // , headerType: 'form'
        // });
        // console.log(result);

        console.log(req_login);
        let result =await req_login({method:'post',url:'/login',arg:{user_name,password},headerType:'form'});

        console.log(result);
        if(result.data.info == '登录成功！！'){
            routerT.push({
                name:'home'
            })
        }

        commit('login',{user_name,info:result.data.info,token:result.data.token});
        console.log(commit);
        // console.log(commit);  
    }
}